package net.yla.smartbus.module.controller.web.ba.dataServer;

import net.yla.smartbus.core.api.ApiResult;
import net.yla.smartbus.core.base.BaseController;
import net.yla.smartbus.module.ba.dataServer.query.DataServerQuery;
import net.yla.smartbus.module.ba.dataServer.query.DeviceDataServerQuery;
import net.yla.smartbus.module.ba.dataServer.query.VersionInfoQuery;
import net.yla.smartbus.module.ba.dataServer.service.DataServerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *@author:LiuJie
 *@date:2020/9/24
 *@description:数据服务器
 */
@RestController
@RequestMapping("/api/ss/v2.1")
public class DataServerController extends BaseController {

    @Autowired
    private DataServerService dataServerService;


    /**
     * 1.获取所有设备列表
     * @param query
     * @return
     */
    @GetMapping("/device/list")
    public ApiResult listDevice(DataServerQuery query){
        return success(dataServerService.listDeviceId(query));
    }

    /**
     * 2.查询指定列表的设备信息
     * @param query
     * @return
     */
    @GetMapping("/device/query")
    public ApiResult listByDeviceQuery(DeviceDataServerQuery query){
        return success(dataServerService.listByDeviceQuery(query));
    }

    /**
     * 3.获取所有车辆列表
     * @param query
     * @return
     */
    @GetMapping("/vehicle/list")
    public ApiResult listVehicleId(DataServerQuery query){
        return success(dataServerService.listVehicleId(query));
    }

    /**
     * 4.查询指定列表的车辆信息
     * @param query
     * @return
     */
    @GetMapping("/vehicle/query")
    public ApiResult listVehicleInfo(DeviceDataServerQuery query){
        return success(dataServerService.listVehicleInfo(query));
    }

    /**
     * 5.获取所有线路列表
     * @param query
     * @return
     */
    @GetMapping("/route/list")
    public ApiResult listRoutes(DataServerQuery query){
        return success(dataServerService.listRoutes(query));
    }

    /**
     * 6.查询指定列表的线路信息
     * @param query
     * @return
     */
    @GetMapping("/route/query")
    public ApiResult listRoutesInfo(DeviceDataServerQuery query){
        return success(dataServerService.listRoutesInfo(query));
    }


    /**
     * 7.查询指定线路列表的支线信息
     * @param query
     * @return
     */
    //@GetMapping("/line/query")
    public ApiResult listLinesInfo(DeviceDataServerQuery query){
        return success(dataServerService.listLinesInfo(query));
    }

    /**
     * 8.获取支线关联的站台列表
     * @param query
     * @return
     */
    @GetMapping("/route/stand")
    public ApiResult listStandLine(DeviceDataServerQuery query){
        return success(dataServerService.listStandLine(query));
    }

    /**
     * 9.首趟获取所有站点列表
     * @param query
     * @return
     */
    @GetMapping("/station/list")
    public ApiResult listStationId(DataServerQuery query){
        return success(dataServerService.listStationId(query));
    }

    /**
     * 10.查询指定站点列表的站点信息
     * @param query
     * @return
     */
    @GetMapping("/station/query")
    public ApiResult listStationInfo(DeviceDataServerQuery query){
        return success(dataServerService.listStationInfo(query));
    }

    /**
     * 11.查询指定站台列表的站台信息
     * @param query
     * @return
     */
    @GetMapping("/stand/query")
    public ApiResult listStandByStandId(DeviceDataServerQuery query){
        return success(dataServerService.listStandByStandId(query));
    }

    /**
     * 12.查询驾驶员列表
     * @param query
     * @return
     */
    @GetMapping("/driver/list")
    public ApiResult listDriverId(DataServerQuery query){
        return success(dataServerService.listDriverId(query));
    }

    /**
     * 13.查询驾驶员信息
     * @param query
     * @return
     */
    @GetMapping("/driver/query")
    public ApiResult listDriverInfo(DeviceDataServerQuery query){
        return success(dataServerService.listDriverInfo(query));
    }

    /**
     * 14.获取指定支线列表
     * @param query
     * @return
     */
    @GetMapping("/line/list")
    public ApiResult listLineId(DataServerQuery query){
        return success(dataServerService.listLineId(query));
    }

    /**
     * 15.获取所有站台信息
     * @param query
     * @return
     */
    @GetMapping("/stand/list")
    public ApiResult listStandIdInfo(DataServerQuery query){
        return success(dataServerService.listStandIdInfo(query));
    }

    /**
     * 16.查询指定支线列表的支线信息
     * @param query
     * @return
     */
    @GetMapping("/line/query")
    public ApiResult listLineInfo(DeviceDataServerQuery query){
        return success(dataServerService.listLineInfo(query));
    }

    /**
     * 17.查询记录版本更新信息
     * @param query
     * @return
     */
    @GetMapping("/version/query")
    public ApiResult listVersion(VersionInfoQuery query){
        return success(dataServerService.listVersion(query));
    }
}
